import styles from './index.less';
import { Button } from 'antd';
import { useEffect } from 'react';
import { history, request } from 'umi';

export default function IndexPage(props: any) {
  // console.log(props);

  useEffect(() => {
    // setTimeout(() => {
    //   history.push('/user/two')
    // }, 2000)
  });

  const getData = async () => {
    const data = await request('/api/users');
    // console.log(data);
  };

  return (
    <div>
      <h1 className={styles.title}>Page index</h1>
      <Button type="primary" onClick={getData}>
        点我获取数据
      </Button>
    </div>
  );
}
